home *** CD-ROM | disk | FTP | other *** search
- {$S-}{$R-}
-
- { TYPETEST.PAS Created August 27, 1992
- By Ray Sun
-
- This program accompanies RAND.TPU and RAND.PAS as a demonstration
- program for the use of the good random numbers. It chooses a random
- number between 1 and 20 and prompts for the user to type that character.
- This particular program, as currently set up, helps to improve the
- typing of the number keys and symbols above them.
-
- }
-
- Uses crt, rand;
-
- const questions = 20;
-
- Var loop, num : integer;
- letter : array [1..questions] of char;
- answer : char;
-
- BEGIN
-
- letter[1]:='!';
- letter[2]:='@';
- letter[3]:='#';
- letter[4]:='$';
- letter[5]:='%';
- letter[6]:='^';
- letter[7]:='&';
- letter[8]:='*';
- letter[9]:='(';
- letter[10]:=')';
- letter[11]:='1';
- letter[12]:='2';
- letter[13]:='3';
- letter[14]:='4';
- letter[15]:='5';
- letter[16]:='6';
- letter[17]:='7';
- letter[18]:='8';
- letter[19]:='9';
- letter[20]:='0';
-
- Clrscr;
- Initialize; { Note that you must initialize the random numbers }
- Writeln('TYPETEST - by Ray Sun');
- Writeln('The program will not continue until the correct key is typed.');
- Writeln('Type the key to continue, ESC to abort program.');
- Writeln;
- For loop := 1 to 10 do
- begin
- Answer := ' ';
- num := RandomNumber (questions); { RAND.TPU in action! }
- writeln(letter[num]);
- While answer <> letter[num] do
- begin
- answer:=readkey;
- If answer=#27 then halt;
- end;
- end;
- END.
-